package com.foreigntrade.xiao.controller;

import com.foreigntrade.xiao.bean.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@Slf4j
@RestController
@RequestMapping("/home")
public class HomeController {

    @RequestMapping("/index")
    public Result index(HttpServletRequest request){
        String ip = request.getRemoteHost();
        String page = request.getParameter("page");

        log.info("访问的IP：{},页面：{}",ip,page);
        return new Result(true,"初始化成功！");
    }
}
